<template>
	<view style="margin:400rpx;">
		<view class="box">
			<view class="cover-page"></view>
			<view class="inside-page"></view>
			<view class="inside-page"></view>
			<view class="inside-page"></view>
			<view class="inside-page"></view>
			<view class="end-page">
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
			}
		}
	}
</script>

<style lang="scss">
	.box {
		width: 150px;
		height: 220px;
	}

	/*给所有view绝对定位，并添加圆角和阴影*/
	.box view {
		position: absolute;
		border-radius: 0 8px 8px 0;
		/*圆角顺序为左上、右上、右下、左下 */
		box-shadow: 1px 5px 5px rgba(0, 0, 0, 0.2);
	}

	/*给封面页添加渐变属性和大小*/
	.cover-page {
		width: 100%;
		height: 100%;
		background-image: linear-gradient(to top right, #222120, #838382);
	}

	/*给封底页添加渐变属性和大小*/
	.end-page {
		background-image: linear-gradient(to top right, #222120, #838382);
		width: 100%;
		height: 100%;
	}

	/*给内容页添大小定位以及底色边框*/
	.inside-page {
		width: 96%;
		height: 96%;
		left: 0;
		top: 2%;
		border: 1px lightgray solid;
		background-color: #fcf9f4;
	}

	.box {
		perspective: 800px;
		transform-style: preserve-3d;
	}

	.box view {
		transform-origin: left;
	}

	.box view:nth-of-type(1) {
		transform: rotateY(-28deg);
	}

	.box view:nth-of-type(2) {
		transform: rotateY(-26deg);
	}

	.box view:nth-of-type(3) {
		transform: rotateY(-24deg);
	}

	.box view:nth-of-type(4) {
		transform: rotateY(-22deg);
	}

	.box view:nth-of-type(5) {
		transform: rotateY(-20deg);
	}

	.box view:nth-of-type(6) {
		transform: rotateY(-18deg);
	}

	/*鼠标离开页面回翻的旋转时间*/
	.box view:nth-of-type(1) {
		transition: 1s;
	}

	.box view:nth-of-type(2) {
		transition: 0.85s;
	}

	.box view:nth-of-type(3) {
		transition: 0.7s;
	}

	.box view:nth-of-type(4) {
		transition: 0.55s;
	}

	/*鼠标悬停时的旋转角度和旋转时间*/
	.box:hover view:nth-of-type(1) {
		transform: rotateY(-160deg);
		transition: 1s;
	}

	.box:hover view:nth-of-type(2) {
		transform: rotateY(-150deg);
		transition: 1.3s;
	}

	.box:hover view:nth-of-type(3) {
		transform: rotateY(-140deg);
		transition: 1.6s;
	}

	.box:hover view:nth-of-type(4) {
		transform: rotateY(-130deg);
		transition: 1.9s;
	}
</style>
